home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1995-12-31 | 89.1 KB | 2,304 lines | [ TEXT/R*ch]
Received-Date: Thu, 10 Mar 1994 19:07:16 +0100 From: pottier@clipper.ens.fr (Francois Pottier) Subject: CSMP Digest, Issue 1 To: csmp-digest@ens.fr Date: Thu, 10 Mar 94 19:07:11 MET X-Mailer: ELM [version 2.3 PL11] Errors-To: listman@ens.fr Reply-To: pottier@clipper.ens.fr X-Sequence: 2 C.S.M.P. Digest Thu, 10 Mar 94 Volume 3 : Issue 1 Today's Topics: Async PBRead in a VBL C compilers for the MAC - Summary Fortran compilers for the Mac Getting time zone settings from Map control panel Grow-box icon drawn w-o scroll lines How to get all fonts ? Interacting with a POP Server Interrupting an interrupt Partial pathnames in FSMake PowerPC & CFM query Rules for Using This Newsgroup??? Sending Apple Events from Excel Strange launch erroor TCL- CDLOGDialog [?] Time Manager Tip for Think C and Radius monitor users Universal Headers (A) c source code for simple-classic-old mac arcade type games wanted showtext-pascal The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier (pottier@clipper.ens.fr). The digest is a collection of article threads from the internet newsgroup comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi- regularly and want an archive of the discussions. If you don't know what a newsgroup is, you probably don't have access to it. Ask your systems administrator(s) for details. If you don't have access to news, you may still be able to post messages to the group by using a mail server like anon.penet.fi (mail help@anon.penet.fi for more information). Each issue of the digest contains one or more sets of articles (called threads), with each set corresponding to a 'discussion' of a particular subject. The articles are not edited; all articles included in this digest are in their original posted form (as received by our news server at nef.ens.fr). Article threads are not added to the digest until the last article added to the thread is at least two weeks old (this is to ensure that the thread is dead before adding it to the digest). Article threads that consist of only one message are generally not included in the digest. The digest is officially distributed by two means, by email and ftp. If you want to receive the digest by mail, send email to listserv@ens.fr with no subject and one of the following commands as body: help Sends you a summary of commands subscribe csmp-digest Your Name Adds you to the mailing list signoff csmp-digest Removes you from the list Once you have subscribed, you will automatically receive each new issue as it is created. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest. Questions related to the ftp site should be directed to scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP digest are available there. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src. ------------------------------------------------------- >From mxmora@unix.sri.com (Matt Mora) Subject: Async PBRead in a VBL Date: 23 Feb 1994 09:53:24 -0800 Organization: SRI International, Menlo Park, CA I'm looking for some advice. I need to poll a device on the serial port and read the data it spits out. Since I don't know how long the device might take to respond (usally longer than one tick) I'm assuming I need to to a Async PBRead since I don't want to tie up the system waiting for a character. So what the best way to appoach this? Do I use a few global flags to indicate a read is in progress and time out and try agian if it doesn't respond the first time? For example (c style pseudo code follows): // see if any data awaits and start the read is there is if (SerGetBuf(refNum,&count) == noErr || !gReadInProgress){ gReadInProgress = true; gTimeout = TickCount() + kTimeOutValue; <fill in pb block> oe = PBRead(pb,true); } // check for no error and for completion if (pb.ioResult==noErr && gReadComp){ //gReadComp set by completion rtn <we got our data> } // check for time out if (gReadInProgress && TickCount() >= gTimeOut && !gReadComp ){ // No response Try again gReadInProgress = false; // How do I stop the async read that is pending? KillIO? } Is SerGetBuf appropriate here or is there a low level version I should be using. The problem that I'm trying to solve is that we were using FSRead which would hang the system if no characters were waiting. Appearently, it was possible to be interupted between the call SGB and FSRead and something else might have gobbled up that character that we were about to read, so the system would lock up waiting for the nonexistant char. Is that what you would call a deadly embrace? This interupt coding is interesting. Xavier -- ___________________________________________________________ Matthew Xavier Mora Matt_Mora@qm.sri.com SRI International mxmora@unix.sri.com 333 Ravenswood Ave Menlo Park, CA. 94025 +++++++++++++++++++++++++++ >From resnick@cogsci.uiuc.edu (Pete Resnick) Date: Wed, 23 Feb 1994 17:17:37 -0600 Organization: University of Illinois at Urbana-Champaign In article <2kg56k$47e@unix.sri.com>, mxmora@unix.sri.com (Matt Mora) wrote: >I'm looking for some advice. I need to poll a device on the >serial port and read the data it spits out. Since I don't know how long the >device might take to respond (usally longer than one tick) I'm assuming >I need to to a Async PBRead since I don't want to tie up the system >waiting for a character. So what the best way to appoach this? Do I use >a few global flags to indicate a read is in progress and time out and >try agian if it doesn't respond the first time? Is there any reason to wait for a timeout? Why not simply put an asynchronous 1-byte PBRead on the serial port? Whenever the data comes in, you will get your completion routine called, and you can do what you need to do. If the device will be sending a lot of data, you will need to then do a SerGetBuf to find out how much data is left and then do a PBRead on the rest of the data. But forget all this stuff about global flags. If you really do want a timeout, put an asynchronous PBRead on the serial port (as much data as you want), and then set up a Time Manager task for the timeout. When the timeout expires, you would call PBKillIO asynchronously. Remember that KillIO clears all outstanding data too, which might not be what you want to do. If the read completes, you can simply remove the TM task. >Is SerGetBuf appropriate here or is there a low level version I should be >using. You should use the low-level PBStatus call with the appropriate csCode for SerGetBuf (2). You can call this immediately if you want to. If you do, you will need to have this glue code: #pragma parameter __D0 PBStatusImmed(__A0) pascal OSErr PBStatusImmed(ParmBlkPtr paramBlock) = 0xA205; Otherwise, you can call it asynchronously. Interrupt programming is wonderful! pr -- Pete Resnick (...so what is a mojo, and why would one be rising?) Graduate assistant - Philosophy Department, Gregory Hall, UIUC System manager - Cognitive Science Group, Beckman Institute, UIUC Internet: resnick@cogsci.uiuc.edu --------------------------- >From ladak@esrican.uucp (Alnoor Ladak) Subject: C compilers for the MAC - Summary Date: Tue, 22 Feb 1994 19:58:57 GMT Organization: ESRI Canada Hi Netters: Due to numerous requests, I have compiled a pseudo-summary of the responses I received for 'C compilers for the Mac'. I have included all the messages so that you may form your own opinions based on the various viewpoints for the same software. The addresses of the individual authors are also included. Hope this helps! I would also like to once again thank all the authors for their input. Thanks tons! AL. ********************************************************************** From: Jacques Marcoux <esri!cmc.aes.doe.CA!jmarcoux> ********************************************************************** There is such beast as shareware C compiler for the Mac, however they are pain in the neck. IMHO your friend would be better off shelling out a $120.00 or so to get Think C from Symantec (educationnal discount) ------------------------------------------------------------------- language: C package: Harvest C version: 1.3 parts: compiler, assembler, linker. author: ? how to get: ftp mac/development/languages/harves* from archive.umich.edu description: The parts of the system are all integrated in a unique application, which manages a "project" composed by several C source files and resource files (which contain data). ports: Macintosh contact: Eric W. Sink updated: 1992/05/26 language: C package: C-Interp version: ? parts: interpreter author: ? how to get: ftp Mac/Misc/C_Interp.sit from oac2.hsc.uth.tmc.edu description: An interpreter for a small subset of C, originally part of a communications package. contact: ? Chuck Shotton <cshotton@oac.hsc.uth.tmc.edu> updated: 1993/05/14 language: C, C++, Objective-C, RTL package: GNU CC (gcc) version: 2.5.5 parts: compiler, runtime, examples, documentation Library listed separately author: Richard Stallman <rms@gnu.ai.mit.edu> and others how to get: ftp gcc-2.4.5.tar.gz from a GNU archive site msdos: ftp pub/msdos/djgpp/* from omnigate.clarkson.edu Macintosh: ftp mpw-gcc-1.37.1r14 from ? ----- try sumex.aim and/or ftp.apple.com ------------------- description: A very high quality, very portable compiler for C, C++, Objective-C. The compiler is designed to support multiple front-ends and multiple back-ends by translating first into RTL (Register Transfer Language) and from there into assembly for the target architecture. Front ends for Ada, Pascal, and Fortran are all under development. conformance: C: superset of K&R C and ANSI C. C++: not exactly cfront 3.0? [could someone tell me which version of cfront it is equivalent to, if any? --ed] Objective-C: ? bugs: gnu.gcc.bug restriction: GNU General Public License ports: 3b1, a29k, aix385, alpha, altos3068, amix, arm, convex, crds, elxsi, fx2800, fx80, genix, hp320, clipper, i386-{dos,isc,sco,sysv.3,sysv.4,mach,bsd,linux,windows,OS/2}, iris,i860, i960, irix4, m68k, m88ksvsv.3, mips-news, mot3300, next, ns32k, nws3250-v.4, hp-pa, pc532, plexus, pyramid, romp, rs6000, sparc-sunos, sparc-solaris2, sparc-sysv.4, spur, sun386, tahoe, tow, umpis, vax-vms, vax-bsd, we32k, hitachi-{SH,8300} ********************************************************************** From: esri!hydra.rose.brandeis.edu!reuber (Kent Reuber) ********************************************************************** Think C from Symantec is one of the best C compilers around. It isn't free, but Symantec offers very generous educational discounts. The cost at Brandeis is about US$60. ********************************************************************** From: esri!ecn.purdue.edu!jess (Jess M Holle) ********************************************************************** DO NOT go shareware on this! On just about any other type of software, I'd advise you to look at shareware first, but not for a Mac C compiler. The only free/shareware C compiler for the Mac OS that works to some degree is Harvest C, but its author has admitted it has lots of bugs and that he has no time to fix them or upgrade the package. Actually, there is 1 _reasonable_ option for the C-guru who likes UNIX. The option is to get MacMint, a freeware UNIX-like pseudo-OS. It runs as a process under the Mac OS, but runs programs compiled for it pre-emptively under it. If you get gcc, etc, for MacMint, then you can compile programs for MacMint and run them. This will only cost you in hard drive space, download time, setup time, learning curve (unless you are a UNIX/gcc guru), etc. I'd recommend either picking up Think C or, for the more serious user, CodeWarrior (which is still in the development stage). Think C is only about $60 educational price. A "teacher friend" ought to be able to finagle this price. Symantec C++ still has some real problems, but Think C is a rather solid ANSI C compiler with a very easy learning curve, nice environment, and good debugger. The $60 would pay off in the first few hours of debugging, since the best debugger the MacMint stuff provides is the GNU version of dbx, if that. Also, Think C automatically figures out how to "make" your projects, so you save all the time that you would spend writing make files under MacMint. Finally, don't forget that programs compiled under MacMint only run under MacMint, so if he would like to have others run the software someday, MacMint is probably out. Think C and Symantec C++ are available from Symantec. CodeWarrior is similar to Think C, BUT only available on CD, is still in development (though anyone can buy it now even), and _probably_ not as well tested. CodeWarrior's C++ _sounds_ more stable than Symantec's, and some limitations of the Think environment are not present in the CodeWarrior environment. CodeWarrior also has educational prices and is available from Metrowerks. >PS. He does not have net access, so please respond to me & I'll This would make MacMint usage more difficult since all the pieces and all the support are available almost solely from the net. The bottom line _to a degree_ is that you get what you pay for. This is not true in the extreme, however. I would not recommend MPW C, which is the other major C option on the Mac. It is expensive, hard-to-use, hard to learn, etc. After using MPW for quite a while, I'd advise against its purchase except for C++ development and even in that case with CodeWarrior out on the market now and Symantec C++ improving. ********************************************************************** From: "Joseph S. D'Elia" <esri!crl.com!silk> ********************************************************************** I don't know of any Shareware C programs out there (that doesn't mean there aren't any) but I have a copy of Think C 5.0 he can buy with all documentation and manuals. It would only cost him $50. I recently purchased Think C 6.0 so I don't need 5.0 anymore. If nothing else comes your way, keep it in mind. It is just sitting on my shelf. ********************************************************************** From: esri!katya.acs.ilstu.edu!bavogler (Benjamin A. Vogler) ********************************************************************** You can get Apple's C GCC compiler from ftp.apple.com... ********************************************************************** From: Chong Richard Ng Kim <esri!cdf.toronto.edu!a260chon> ********************************************************************** Hi Al! Don't know of any shareware C compilers for the Mac. In fact, the only Mac C compilers that I know of are Symantec's THINK C and Apple's MPW C. If your friend is a member of a user group, tell him to call Symantec Canada. (They're in the Toronto phone book.) As a UG member, you can get THINK C for only $79 Canadian (+PST+GST of course!) If your friend isn't a member of a UG, then might I suggest ClubMac? (I'm a CMAC member myself.) There's an info line for CMAC at (416) 462-1702. If your friend wants more info then just leave name & address &/or phone # on the answering machine and someone will be in touch soon thereafter. Hope this helps out some! ********************************************************************** From: esri!astro.uu.se!Olof.Morell (Olof Morell) ********************************************************************** Think C, current version 6.0. Commercial from Symantec corp. If you can find an used 5.0.x version for not too much it's a bargain... Good compiler. ********************************************************************** From: Ben Cottrell <esri!soda.berkeley.edu!benco> ********************************************************************** Try Harvest C, which can be gotten off of sumex-aim.stanford.edu and numerous other places. Tell me if you want more information or need help finding it! ********************************************************************** From: esri!marie.physik.tu-berlin.de!georg (Georg Schwarz) ********************************************************************** Harvest C 1.3 is freeware. Try it! -- ______________________________________________________________________________ Alnoor Ladak (email aladak@esri.com) |Somebody ought to cross ball point pens ESRI Canada, 49 Gervais Dr., | with coat hangers so that the pens Don Mills, Ont. M3C 1Y9 | will muliply instead of disappear --------------------------- >From csdamle@magnus.acs.ohio-state.edu (Chandrashekhar S Damle) Subject: Fortran compilers for the Mac Date: 22 Feb 1994 18:59:45 GMT Organization: The Ohio State University If anybody has any experience with Macintosh Fortran compilers sold by Language Systems or Absoft, I would appreciate it if they could relate their experiences to me. I am thinking of buying a Fortran compiler for our Mac IIci with system 7.1 I have received some information from both of these companies, but would appreciate it if somebody who has real experience on them could give me their opinions. Thank you. Shekhar Damle damle@kcgl1.eng.ohio-state.edu +++++++++++++++++++++++++++ >From chang@oasys.dt.navy.mil (Peter Chang) Date: 23 Feb 1994 08:37:02 -0500 Organization: Carderock Division, NSWC, Bethesda, MD In comp.lang.fortran, csdamle@magnus.acs.ohio-state.edu (Chandrashekhar S Damle) writes: >If anybody has any experience with Macintosh Fortran compilers sold >by Language Systems or Absoft, I would appreciate it if they could >relate their experiences to me. > I have been using Language Systems Fortran for the Mac for the past 5 years. I have no experience with Absoft. Here's a random list of thoughts concerning LS Fortran running inside MPW: - you have to learn how to get around inside the MPW shell. At first a little arcane, but eventually feels like a low power Unix shell. YOu can customize MPW to the same commands as Unix. MPW gives you command line file maniupulation (as opposed to Finder) which is very powerful and makes up for the deficiencies in Finder. - the LS Fortran has some very nice extensions, e.g. cycle and leave statements for do loops. - the editor makes programming very quick. For instance indenting large blocks of code makes programming much more organized. I have not used a statement label (except for formats) in a long time. - many compiler options for various debugging modes and optimization levels. - source code debugger - I do all my programming in MPW, then port over to various Crays etc. - My comments are more based on use of MPW. I am very pleased with LS Fortran, but as stated above cannot compare it with Absoft. Please email me if you have more specific questions. ------------------------------------------------------------------------------ Peter Asha Chang, III |"That's exactly the method", the Bellman bold chang@oasys.dt.navy.mil | In a hasty parenthesis cried, 301.227.1798 (voice) |"That's exactly the way I have always been told 301.227.3883 (fax) | That the capture of Snarks should be tried" David Taylor Model Basin | --Lewis Carroll Bethesda, MD, USA | Alice in Wonderland ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Peter Asha Chang, III |"That's exactly the method", the Bellman bold chang@oasys.dt.navy.mil | In a hasty parenthesis cried, 301.227.1798 (voice) |"That's exactly the way I have always been told 301.227.3883 (fax) | That the capture of Snarks should be tried" David Taylor Model Basin | --Lewis Carroll Bethesda, MD, USA | Alice in Wonderland ------------------------------------------------------------------------------- +++++++++++++++++++++++++++ >From shepard@bonnie.mcs.anl.gov (Ron Shepard) Date: Wed, 23 Feb 1994 18:34:51 GMT Organization: Argonne National Laboratory, Chicago, Illinois In article <2kfm5uINN56n@oasys.dt.navy.mil> chang@oasys.dt.navy.mil (Peter Chang) writes: > >In comp.lang.fortran, csdamle@magnus.acs.ohio-state.edu (Chandrashekhar S Damle) writes: >>If anybody has any experience with Macintosh Fortran compilers sold >>by Language Systems or Absoft, I would appreciate it if they could >>relate their experiences to me. >> >I have been using Language Systems Fortran for the Mac for the past >5 years. I have no experience with Absoft. Here's a random list of >thoughts concerning LS Fortran running inside MPW: [...] I have experimented with various versions of LS Fortran on the Mac too, but I always seemed to run into some small bug that would stop me from doing what I needed to do. I don't mean to pick on LS Fortran in particular; this comment probably applies to all PC type fortran compilers. I just don't know if you can really expect to find "industrial strength" compilers like those you find on workstations, minis, supercomputers, etc. For example, I remember with LS Fortran that list-directed I/O on character arrays would not work. Many of my application codes use this, so when I ran into the bug, it pretty much halted progress. character*8 carray(5) data carray/ '1', '2', '3', '4', '5' / read(5,*) carray write(6,*) carray end input file: 'new1' 'new2' / take the default values for the rest When executed, the correct output should be: new1 new2 3 4 5 But with (on several versions at least) LS Fortran you get: new1 new2 / take the Maybe this has been fixed (anyone know?). It is just something to watch out for with PC-class compilers. $.02 -Ron Shepard +++++++++++++++++++++++++++ >From walsteyn@fys.ruu.nl (Fred Walsteijn) Date: Wed, 23 Feb 1994 22:58:14 GMT Organization: Physics Department, University of Utrecht, The Netherlands In <76202849143920@bonnie.mcs.anl.gov> shepard@bonnie.mcs.anl.gov (Ron Shepard) writes: >.... I just don't know if you can really expect to find >"industrial strength" compilers like those you find on workstations, >minis, supercomputers, etc. >For example, I remember with LS Fortran that list-directed I/O on >character arrays would not work. Many of my application codes use >this, so when I ran into the bug, it pretty much halted progress. > character*8 carray(5) > data carray/ '1', '2', '3', '4', '5' / > read(5,*) carray > write(6,*) carray > end > [stuff deleted] >Maybe this has been fixed (anyone know?). It is just something to watch >out for with PC-class compilers. Hello Ron, The latest version of LS Fortran (3.3) works OK: ***input: 'new1' 'new2' / take the default values for the rest ***output: new1 new2 3 4 5 I agree with your remark on the quality of compilers. If you limit yourself to the Mac, however, then LS Fortran is a good choice. I use the MPW Shell for 90% of my Fortran code editing, and use LS Fortran (sometimes) for some initial tests (and use FTNCHEK in MPW as well). At home I do all my work with LS Fortran. _____________________________________________________________________________ Fred Walsteijn | Internet: walsteyn@fys.ruu.nl Institute for Marine and Atmospheric Research | FAX: 31-30-543163 Utrecht University, The Netherlands | Phone: 31-30-533169 --------------------------- >From neeri@iis.ee.ethz.ch (Matthias Neeracher) Subject: Getting time zone settings from Map control panel Date: 20 Feb 1994 21:08:56 GMT Organization: Swiss Federal Institute of Technology (ETHZ) I am wondering if there is a way to derive time zone information from the settings of the Map control panel. I seem to have seen this in a few programs. On a related topic, can anybody who has used this information comment on how high a percentage of Mac users configures their Map control panel correctly? Respondents will earn my eternal gratitude. Matthias ----- Matthias Neeracher neeri@iis.ee.ethz.ch "Success is what me make of the mess we have made out of things" +++++++++++++++++++++++++++ >From wdh@netcom.com (Bill Hofmann) Date: Sun, 20 Feb 1994 22:12:43 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) neeri@iis.ee.ethz.ch (Matthias Neeracher) writes: >I am wondering if there is a way to derive time zone information from >the settings of the Map control panel. I seem to have seen this in >a few programs. On a related topic, can anybody who has used this >information comment on how high a percentage of Mac users configures >their Map control panel correctly? ReadLocation reads a rather bizarre data structure which encodes the current lat/long and the time zone. Currently undocumented (uh oh) but important: the union that encodes the time zone info and the "dlsDelta" uses the high order bit of dlsDelta to tell you that daylight savings is currently on, at least in System 7 Pro. See IM VI for more info. Another piece of info: gmtDelta reflects not the time zone but the delta from GMT, which may need to be adjusted if DST is on. Well, I'd guess a small percentage use this feature. 7Pro encourages it, but since my software requires it, I more or less force the user to set it. >Respondents will earn my eternal gratitude. Wow. >Matthias >----- >Matthias Neeracher neeri@iis.ee.ethz.ch > "Success is what me make of the mess we have made out of things" -- -Bill Hofmann wdh@netcom.COM Fresh Software and Instructional Design +1 510 524 0852 +++++++++++++++++++++++++++ >From neeri@iis.ee.ethz.ch (Matthias Neeracher) Date: 22 Feb 94 17:44:14 Organization: Integrated Systems Laboratory, ETH, Zurich In article <wdhCLJn18.7r1@netcom.com>, wdh@netcom.com (Bill Hofmann) writes: > neeri@iis.ee.ethz.ch (Matthias Neeracher) writes: >>I am wondering if there is a way to derive time zone information from >>the settings of the Map control panel. > ReadLocation reads a rather bizarre data structure which encodes the > current lat/long and the time zone. Thank you very much. As soon as I had the routine name, I was able to find what was documented in the Script Manager chapter of IM VI. This information doesn't seem to have made it into the Script Manager chapter of NIM:Text (doesn't have much to do with text, anyway), I wonder where it will end up in the NIM series. > Well, I'd guess a small percentage use this feature. This was also the consensus of the e-mail messages I received. Thanks to Michael Hanson, Scott M. Silver, and Douglas Rowe for their helpful suggestions. Matthias ----- Matthias Neeracher neeri@iis.ee.ethz.ch "And that's why I am going to turn this world upside down, and make of it a fire so *bright* that someone real will notice" -- Vernor Vinge, _Tatja Grimm's World_ --------------------------- >From tim@zikzak.apana.org.au (Tim Shimmin) Subject: Grow-box icon drawn w-o scroll lines Date: 22 Feb 1994 13:34:50 +1100 Organization: Zikzak Public Access UNIX, Melbourne Australia I would like to be able to draw the grow-box icon for a window but without the scroll-lines being drawn - which happens when calling DrawGrowIcon. Could someone please enlighten me as to how it is done. I have a vertical palette on the left hand side which I don't want "over-drawn" by a scroll line. Thanks. --tim -- Tim Shimmin - tim@zikzak.apana.org.au Zikzak public access UNIX, Melbourne, Australia. +++++++++++++++++++++++++++ >From b-clark@nwu.edu (Brian Clark) Date: Mon, 21 Feb 1994 22:25:31 -0600 Organization: Northwestern University In article <2kbr0o$se1@zikzak.apana.org.au>, tim@zikzak.apana.org.au (Tim Shimmin) wrote: > I would like to be able to draw the grow-box icon for > a window but without the scroll-lines being drawn - > which happens when calling DrawGrowIcon. > Could someone please enlighten me as to how it is done. > I have a vertical palette on the left hand side which > I don't want "over-drawn" by a scroll line. I believe one way to do this is covered in one of the Macintosh Inside Out series of books from Addison-Wesley titled "Macintosh Programming Secrets" by a couple of unknowns named Knaster and Rollins :-). As I recall, the secret is to save the current clip region, set the new clip region to include only the icon, call DrawGrowIcon, then restore the original clip region. +++++++++++++++++++++++++++ >From Carl R. Osterwald <carl_osterwald@nrel.gov> Date: Mon, 21 Feb 94 04:39:43 GMT Organization: National Renewable Energy Lab. In article <2kbr0o$se1@zikzak.apana.org.au> Tim Shimmin, tim@zikzak.apana.org.au writes: >I would like to be able to draw the grow-box icon for >a window but without the scroll-lines being drawn - >which happens when calling DrawGrowIcon. >Could someone please enlighten me as to how it is done. Sure. 1. Save existing window clipping region 2. Set clipping region to rectangle containing only GrowIcon 3. Call DrawGrowIcon 4. Restore window clipping region +++++++++++++++++++++++++++ >From rmah@panix.com (Robert S. Mah) Date: Tue, 22 Feb 1994 00:01:51 -0500 Organization: One Step Beyond tim@zikzak.apana.org.au (Tim Shimmin) wrote: > I would like to be able to draw the grow-box icon for a window but without > the scroll-lines being drawn - which happens when calling DrawGrowIcon. > Could someone please enlighten me as to how it is done. Sure thing. See the code below. Cheers, Rob ________________________________________________________________________ Robert S. Mah One Step Beyond rmah@panix.com #define kGrowBoxSize 16 void DrawGrowIconNoLines( WindowPtr wp, Boolean hideLines ) { RgnHandle saveClip; GrafPtr savePort; Rect growBox; if( hideLines == false ){ DrawGrowIcon( wp ); }else{ saveClip = NewRgn(); if( saveClip == NULL ) return; GetPort( &savePort ); SetPort( wp ); GetClip( saveClip ); growBox.right = wp->portRect.right; growBox.bottom = wp->portRect.bottom; growBox.left = growBox.right - kGrowBoxSize; growBox.top = growBox.bottom - kGrowBoxSize; ClipRect( &growBox ); DrawGrowIcon( wp ); SetClip( saveClip ); SetPort( savePort ); DisposeRgn( saveClip ); } } --------------------------- >From a-kowald@nimr.mrc.ac.uk (Axel Kowald) Subject: How to get all fonts ? Date: Mon, 21 Feb 1994 10:20:08 GMT Organization: Manchester Computing Centre Hi What is the proper way to get a list of all fonts which are installed on a mac ? I could use GetFontName() but it seems the font numbers can be scattered around the whole integer range. I can't imagine I have to scan all integer numbers, so what is the way to do it ? Thanks Axel (a_kowald@nimr.mrc.ac.uk) +++++++++++++++++++++++++++ >From Reid Ellis <rae@Alias.com> Date: Tue, 22 Feb 1994 20:06:41 GMT Organization: Alias Research, Inc., Toronto ON Canada Axel Kowald <a-kowald@nimr.mrc.ac.uk> writes: |What is the proper way to get a list of all fonts which are |installed on a mac ? I could use GetFontName() but it seems the |font numbers can be scattered around the whole integer range. I |can't imagine I have to scan all integer numbers, so what is the |way to do it ? I can't remember where I saw it, but the documented way of doing this is to create a menu, call AddResMenu(theMenu, 'FOND') [*not 'FONT'!], loop through all the menu items, copying the item's string into a list of font names you are creating, and when you are done, get rid of the menu again. Intuitive, eh? :-/ Reid -- Reid Ellis, Alias Research Inc. +1 416 362 9181 <rae@Alias.com> --------------------------- >From Scott_Gruby@hmc.edu (Scott Gruby) Subject: Interacting with a POP Server Date: Sat, 19 Feb 1994 23:19:35 -0800 Organization: Harvey Mudd College, Claremont CA Does anyone out there know how to interact with a POP server via MacTCP? What I would like to do is simply send a username and password and see if new mail is there and then close the connection (I don't want to get the mail.). a) What commands do I have to send to the POP server? b) What is the easiest way to do it? Thanks. -- Scott Allen Gruby (Scott_Gruby@hmc.edu) +++++++++++++++++++++++++++ >From peter@ncrpda.curtin.edu.au (Peter N Lewis) Date: 21 Feb 1994 11:16:19 +0800 Organization: NCRPDA, Curtin University Scott_Gruby@hmc.edu (Scott Gruby) writes: >Does anyone out there know how to interact with a POP server via MacTCP? >What I would like to do is simply send a username and password and see if >new mail is there and then close the connection (I don't want to get the >mail.). POP, like all good protocols (and surprisingly enough, POP is actually quite a good protocol) is documented in an RFC (Request for Comment). They are stored at munnari.oz.au:/rfc (amoungst other places). This directory has zillions of files in it, so listing it is somewhat tedious. The relevent file is munnari.oz.au:rfc/POP3.Z. telnet <ip> pop3 R: +OK ncrpda POP3 Server (Version 1.002) ready. S: user peter R: +OK please send PASS command S: pass ***** R: +OK 0 messages ready for peter in /usr/spool/mail/peter S: quit R: +OK whatever Enjoy, Peter. -- _______________________________________________________________________ Peter N Lewis <peter.lewis@info.curtin.edu.au> Ph: +61 9 368 2055 +++++++++++++++++++++++++++ >From philip@concave.cs.wits.ac.za (Philip Machanick) Date: Mon, 21 Feb 1994 12:21:54 +0200 Organization: Computer Science Dept, U of Witwatersrand In article <Scott_Gruby-190294231935@eagle.st.hmc.edu>, Scott_Gruby@hmc.edu (Scott Gruby) wrote: > Does anyone out there know how to interact with a POP server via MacTCP? > What I would like to do is simply send a username and password and see if > new mail is there and then close the connection (I don't want to get the > mail.). > > a) What commands do I have to send to the POP server? > > b) What is the easiest way to do it? Telnet to your mail host to port 110 (or 109 if that doesn't work), tell it who you are then quit. For example - replace "concave" by the name of your mail host in what follows, and of course put in your own user name and password (lines starting with "+" are output from the server): -- telnet concave 110 Trying 146.141.15.20... Connected to concave.cs.wits.ac.za. Escape character is '^]'. +OK UCB Pop server (version 1.831beta) at concave.cs.wits.ac.za starting. user philip +OK Password required for philip. pass ######## +OK philip has 0 message(s) (0 octets). quit +OK Pop server at concave.cs.wits.ac.za signing off. Connection closed by foreign host. -- If you want to write a program to do this, good luck. -- Philip Machanick philip@concave.cs.wits.ac.za Department of Computer Science, University of the Witwatersrand 2050 Wits, South Africa phone 27(11)716-3309 fax 27(11)339-7965 --------------------------- >From shiekh@ictp.trieste.it (Andy Shiekh) Subject: Interrupting an interrupt Date: Mon, 21 Feb 1994 12:24:48 +0100 Organization: International Centre for Theoretical Physics I recently read in "The Art of Electronics" concerning programming the 68000 series that: In order to prevent pandemonium, the CPU disables interrupts when it jumps to the handler, and reenables them when it executes RTE. If you have a long winded handler, you may want to re-enable interrupts (at higher-priority levels only) within the handler, which you can do by sending the appropriate byte to the status register. Can anyone enlighten me on what the appropriate byte is? Andy +++++++++++++++++++++++++++ >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Date: 22 Feb 94 11:32:53 +1300 Organization: University of Waikato, Hamilton, New Zealand In article <shiekh-210294122448@mac-160.ictp.trieste.it>, shiekh@ictp.trieste.it (Andy Shiekh) writes: > I recently read in "The Art of Electronics" concerning programming > the 68000 series that: > > In order to prevent pandemonium, the CPU disables interrupts when > it jumps to the handler, and reenables them when it executes RTE. > If you have a long winded handler, you may want to re-enable interrupts > (at higher-priority levels only) within the handler, which you can do > by sending the appropriate byte to the status register. I was aware of no such thing. My understanding of interrupt handling on the 68K family (or on any CPU family, for that matter), is that a) the priority of the interrupt request is compared against the current CPU priority, and the interrupt is only granted if its priority is higher, and b) before entering the interrupt service routine, the CPU priority is raised to the interrupt priority. This blocks out further interrupts at the same or a lower priority, until the interrupt service routine has finished. Thus there is no automatic disabling of _all_ interrupts--just those that haven't got a higher priority. The only time that code needs to fiddle the CPU priority is when it is synchronizing with interrupt code. For example, say you're writing a device driver for a device that generates interrupts at priority p. When driver code (for example, invoked as a result of a user call) needs to access data structures that are also accessed by the interrupt service routine, then you need to raise the priority to at least p while doing the access (and restore it to what it was before afterwards), otherwise you could end up with inconsistent data. Note: you should never *lower* CPU priority from what it was when your code was entered. Doing so can destroy the interrupt nesting scheme, break the synchronization assumptions in other interrupt handlers, and generally cause havoc. Lawrence D'Oliveiro fone: +64-7-856-2889 Info & Tech Services Division fax: +64-7-838-4066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00 --------------------------- >From pindar3@cix.compulink.co.uk (Pindar Infotek Ltd) Subject: Partial pathnames in FSMake Date: 22 Feb 1994 03:02:35 -0600 Organization: UTexas Mail-to-News Gateway >From Pindar user Ian McCall Subject: _Partial pathnames in FSMakeFSSpec Hello. I'm having a problem locating files in a directory structure that's been set up. The structure is as follows: File server root:Notes:a:b:c:abcxxx where a, b, and c are single digits, and xxx are also digits. I've set up an alias resource to 'File server root', which is correctly being resolved. I'd now like to use the FSSpec I receive through that resolution plus a partial pathname of 'Notes:a:b:c:abcxxx' to specify a file. Whenever I try however, I'm constistently getting back a -35 err - no such volume. I've set the FSSpec of the file to equal fileServerRoot.vRefNum, fileServerRoot.parID, and 'Notes:a:b:c:abcxxx' for each of the fields. What's going wrong? Please reply via email, since I don't actually get to read this group. Thanks in advance for any information. --- Please make 'Attn:<space>Ian McCall' the first line of your reply (not the subject) to ensure automatic forwarding to the correct Pindar user. +++++++++++++++++++++++++++ >From peter@ncrpda.curtin.edu.au (Peter N Lewis) Date: 23 Feb 1994 11:25:17 +0800 Organization: NCRPDA, Curtin University pindar3@cix.compulink.co.uk (Pindar Infotek Ltd) writes: >through that resolution plus a partial pathname of >'Notes:a:b:c:abcxxx' to specify a file. Whenever I try however, I'm >constistently getting back a -35 err - no such volume. Thats because 'Notes:a:b:c:abcxxx' is not a partial pathname. Its a full pathname. ':Notes:a:b:c:abcxxx' is what you want. A pathname is partial if and only iff it contains no colons, or it starts with a colon. >What's going wrong? Please reply via email, since I don't actually >get to read this group. See my note about "rules for posting" ;-) Peter. -- _______________________________________________________________________ Peter N Lewis <peter.lewis@info.curtin.edu.au> Ph: +61 9 368 2055 --------------------------- >From Brian Patrick Arnold <ba0k+@andrew.cmu.edu> Subject: PowerPC & CFM query Date: Tue, 22 Feb 1994 18:58:45 -0500 Organization: Sponsored account, Engineering and Public Policy, Carnegie Mellon, Pittsburgh, PA I have some hard questions regarding PowerPC migration that I figure I ought to start addressing as soon as possible. I want some of you to help me guestimate the tradeoffs in migrating a MacApp 2.0 application to PowerPC. Please reply directly to me and I will do my best to summarize any helpful replies. Assumptions: ----------- o App uses MacApp 2.0 with "7.0 for MacApp 2.0" modifications o App's user interface is written in MPW Object Pascal 3.2 o App's kernel (50% of code) is written in C, with a tiny bit of C++, with no MacApp/PascalObject dependency (except via vanilla procedures) o App's kernel has all relevant computation-intensive code o App has been tested to run on PowerPC architecture with its unmodified 68k code Hard choices: ------------ a. Port the kernel to PowerPC but keep the interface in MC68k b. Port the kernel and interface code as-is, all for PowerPC c. Translate interface code to C++, upgrade to MacApp 3.0 and then 3.1 The goal being sought is to change as little code as possible in as little time as possible. I have a sneaky suspicion that I can get away with option (a) in far less time than option (b) or (c) if I knew the rights answers as to how to do it. Tradeoffs: --------- Option (a) requires dipping into code fragments and/or dynamic linking. How hard is it to turn half of an existing API on its head, compile part of it for PowerPC and have it be directly accessible with 68k code via the Code Fragment Manager? Easy? Tedious? Option (b) I assume requires modifying MacApp 2.0 to handle Universal headers and having a PowerPC Pascal compiler than can handle MacApp 2.0. How hard can one estimate modifying MacApp 2.0 to be? Also has anyone heard whether a PowerPC Pascal compiler will support Pascal Objects and MacApp 2.0? Is this simply too far fetched an option? Option (c) is more well-defined but less appealing to me at least in the time frame being considered. This is because translation is expected to take one month, upgrading to MacApp 3.0 is expected to take another month, MacApp 3.1 might take another week, and by then a lot of code has changed, so testing will become a big deal. This sounds like too much work, although I'd like to move to MacApp 3.1 at some point in the distant future (well...). Anyone willing to rise to this challenge and help me make better estimates for option (a), or convince me why option (b) or (c) is better? - Brian +++++++++++++++++++++++++++ >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte) Date: 23 Feb 1994 07:56:03 GMT Organization: Royal Institute of Technology, Stockholm, Sweden In <QhOdkpW00WBM4A6qlT@andrew.cmu.edu> Brian Patrick Arnold <ba0k+@andrew.cmu.edu> writes: >o App uses MacApp 2.0 with "7.0 for MacApp 2.0" modifications Ouch! >o App's user interface is written in MPW Object Pascal 3.2 Aaaahhh... (now has a serious limp and terrible cut above eyes) >o App's kernel (50% of code) is written in C, with a tiny bit of > C++, with no MacApp/PascalObject dependency (except via > vanilla procedures) Oh, that's better (bandages in place) >o App has been tested to run on PowerPC architecture with its > unmodified 68k code Well, that doesn't make transition harder nor easier. If you run on a 68k Mac, you run on the PowerPC emulation. No surprise there. >a. Port the kernel to PowerPC but keep the interface in MC68k This is, technically, a bear, since there is no linker currently available which can grok 68k and PPC code at the same time. >b. Port the kernel and interface code as-is, all for PowerPC Hard to do, sincC++ and MacApp 3.1 is needed. >c. Translate interface code to C++, upgrade to MacApp 3.0 and then 3.1 I would suggest re-implementing the interface code in MacApp 3.1 using whatever cool interface editors/code generators you can get your grubby on. >The goal being sought is to change as little code as possible in as >little time as possible. I have a sneaky suspicion that I can get away I think my suggestion would actually be the fastest. AND you get a good shot at cleaning up your UI, if that's needed. -- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe -- "And now, from the makers of EDLIN, comes: Windows NT!" +++++++++++++++++++++++++++ >From zstern@adobe.com (Zalman Stern) Date: Thu, 24 Feb 1994 01:51:55 GMT Organization: Adobe Systems Incorporated Jon W tte writes > In <QhOdkpW00WBM4A6qlT@andrew.cmu.edu> Brian Patrick Arnold <ba0k+@andrew.cmu.edu> writes: > >a. Port the kernel to PowerPC but keep the interface in MC68k > > This is, technically, a bear, since there is no linker currently > available which can grok 68k and PPC code at the same time. Its very easy. Write a PowerPC code fragment which has an entry point that accepts a table of function pointers and returns (a possibly different) table of function pointers. Write jacket functions that call through the table of function pointers on each side. Add initialization code that loads the code fragment and calls it to exchange function tables. If it takes you more than an hour to do this given a list of routine names, you are not an accomplished tools user. (Generating the procinfos for the kernel functions is harder. There's a tool to do it for you, but I doubt its available.) This ignores the problem of global variables. If you have lots of them, think of this as an opportunity to improve your code and remove them. You can add pointers to the globals to information that gets exchanged during the initialization handshake. You will have to revise the kernel code to deal with an extra level of indirection on its globals. [...] > >c. Translate interface code to C++, upgrade to MacApp 3.0 and then 3.1 > > I would suggest re-implementing the interface code in MacApp 3.1 > using whatever cool interface editors/code generators you can get > your grubby on. > > >The goal being sought is to change as little code as possible in as > >little time as possible. I have a sneaky suspicion that I can get away > > I think my suggestion would actually be the fastest. AND you get a > good shot at cleaning up your UI, if that's needed. Brian's solution is almost certainly faster and less intrusive to the code. (And I have enough direct experience with both MacApp and PowerPC to be very confident in saying that.) The "goodness" of such an approach depends on how well the "kernel" matches the performance cross section of your app. (I.e. does it get you the speed you need.) It also becomes an issue of deferred maintenance. There will be a day when compiling Object Pascal for a 68K is about as easy as compiling Algol 68 for a CDC 6600. -- Zalman Stern zalman@adobe.com (415) 962 3824 Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900 "Do right, and risk consequences." Motto of Sam Houston (via Molly Ivins) --------------------------- >From feats@vtvm1.cc.vt.edu Subject: Rules for Using This Newsgroup??? Date: 20 Feb 1994 09:44:05 -0500 Organization: Virginia Tech, Blacksburg, VA >From: David A Lyons <dlyons@apple.com> >Date: Sat, 19 Feb 1994 06:40:14 GMT >Organization: Apple Computer, Inc. > >(Having the right books handy is a very good thing. You'll save >yourself and everybody else a lot of time by getting them and becoming >familiar with them.) > >Dave Lyons, dlyons@apple.com >Mr Tangent I posed a question to the newsgroup dealing with UpdateEvents and Redrawing the contents of a window. I do not have IM at this time due to lack of funds. I do have Think Reference which has been very helpful and I use this Newsgroup as a source of information. Everyone has been very helpful but after this last response I feel like I'm misusing this newsgroup! What exactly are the rules for posting questions on this Newsgroup? Is there a limit to the quantity of questions one person may ask or do your questions have to be of a certain complexity? I have been using the Macintosh C Programming Primers as a source of information and I was interested in finding out more about UpdateEvents. The Primer led me to belive that you could redraw the whole window or you could keep track of exactly what needed to be updated and only redraw that portion of the window. The examples in the Primers only showed redrawing the whole window so I was wondering if others lived with that approach or if they used more complex code to speed things up!? I used the BeginUpdate/redraw/EndUpdate logic and it worked; I was just trying to make things faster so I asked what others did. Should I not ask such trivial questions on this Newsgroup? Stephen L. Greenfield Phone: (703) 231-4025 1700 Pratt Drive - Computing Center Bitnet: FEATS@VTVM1 Virginia Polytechnic Institute Internet: feats@vtvm1.cc.vt.edu Blacksburg, Virginia 24060-6361 ,/\ feats@feats.cc.vt.edu / `\/`'\ ,/\/ / ,/ <_ ._. / `\ / / ,/\_ _/' `-`-\ |/ ,/' `_'_' * Blacksburg \_> ' ,/' \__>_/\ +----------------------------------------------+ +++++++++++++++++++++++++++ >From sgl1@kimbark.uchicago.edu (Steven Lane) Date: Sun, 20 Feb 1994 17:10:07 GMT Organization: University of Chicago In article <2k7svl$l1m@vtserf.cc.vt.edu> feats@vtvm1.cc.vt.edu writes: >Everyone has been >very helpful but after this last response I feel like I'm misusing this >newsgroup! What exactly are the rules for posting questions on this >Newsgroup? Is there a limit to the quantity of questions one person may >ask or do your questions have to be of a certain complexity? This being the net, there aren't many rules per se. There are standards of etiquette; if you transgress these, you will not be fined, but you may be gently mocked (or not so gently, depending on the offense). In general, when posting questions to a technically-oriented group such as this one, the best rule is not to ask a question until you've tried to figure out the answer yourself. If you didn't read some obvious piece of documentation which answers your question, people may be a little grumpy with you. If, on the other hand, you don't know which obvious piece of your thousands of pages of docs you should read, or you read it and made no sense of it, post away. This is a very helpful group, personality-wise -- many rank beginners (myself included) post questions and receive speedy and thorough answers. At worst, if your question is somehow inappropriate, it will just sit by itself in your thread selector, with no responses. >I have been using the Macintosh C Programming Primers as a source of >information and I was interested in finding out more about UpdateEvents. >The Primer led me to belive that you could redraw the whole window or >you could keep track of exactly what needed to be updated and only >redraw that portion of the window. The examples in the Primers only >showed redrawing the whole window so I was wondering if others lived >with that approach or if they used more complex code to speed things >up!? I used the BeginUpdate/redraw/EndUpdate logic and it worked; I was >just trying to make things faster so I asked what others did. I can't tell whether your question has been answered already; I'll pretend it hasn't. It's actually the Window Manager which keeps track of which part of the window needs to be refreshed. Look at the structure of a WindowRecord and you'll see a field called updateRgn. When you use the Begin/EndUpdate sequence, you are warning the Window Manager that it should make sure your drawing is clipped so as only to go to the updateRgn. [ long .sig deleted ] You might consider trimming your signature file a little, to save bandwidth. -- ---- Steve Lane University of Chicago, Department of History sgl1@midway.uchicago.edu +++++++++++++++++++++++++++ >From watkeyeh@dunx1.ocs.drexel.edu (Edwin H. Watkeys III) Date: Sun, 20 Feb 1994 18:18:41 GMT Organization: Drexel University In article <1994Feb20.171007.20754@midway.uchicago.edu> sgl1@midway.uchicago.edu writes: >In article <2k7svl$l1m@vtserf.cc.vt.edu> feats@vtvm1.cc.vt.edu writes: > >>[ far too considerate poster's comments deleted. ] > >This being the net, there aren't many rules per se. There are >standards of etiquette; if you transgress these, you will not be >fined, but you may be gently mocked (or not so gently, depending on >the offense). In general, when posting questions to a >technically-oriented group such as this one, the best rule is not to >ask a question until you've tried to figure out the answer yourself. >If you didn't read some obvious piece of documentation which answers >your question, people may be a little grumpy with you. If, on the >other hand, you don't know which obvious piece of your thousands of pages >of docs you should read, or you read it and made no sense of it, post >away. This is a very helpful group, personality-wise -- many rank >beginners (myself included) post questions and receive speedy and >thorough answers. At worst, if your question is somehow inappropriate, >it will just sit by itself in your thread selector, with no responses. Isn't that depressing when it happens to one of your posts? It's not necessarly because your question is inappropriate: often, there just isn't anyone out there at the time who knows much of anything about you question. Of course, it could be because everyone thinks you're an asshole. I usually assume the former when I see other people's lonely posts, but the latter when my posts go unanswered... Oh well... You realy need to think before strting a new thread... How are you going to appeal to potential readers with your subject line? How will you phrase your post, so as to get the right people in a responding mood? You want to go for the big names on csmp -- it'll make you feel somehow more worthy... Or maybe I need to see a psychologist... Ed -- Ed Watkeys watkeyeh@dunx1.ocs.drexel.edu Drexel University Philosopher-Programmer EdWatkeys@distant.com Distant Software - Use finger for my PGP key. - +++++++++++++++++++++++++++ >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte) Date: 20 Feb 1994 20:29:43 GMT Organization: Royal Institute of Technology, Stockholm, Sweden In <CLJC75.32C@Dunx1.OCS.Drexel.Edu> watkeyeh@dunx1.ocs.drexel.edu (Edwin H. Watkeys III) writes: >to appeal to potential readers with your subject line? How will you phrase >your post, so as to get the right people in a responding mood? You want to >go for the big names on csmp -- it'll make you feel somehow more worthy... A __BIG__ potential catch here: Once a week or so, I get a letter starting: "I see you answer a lot of questions on comp.sys.mac.programmer, so I figured you could help me with..." I usually answer (politely I hope) that I post to the UseNet on my spare time (lunch breaks or such) for the potential benefit of all UseNet readers, while individual consulting is what I do for a living; short contracts are in the $100/hour range. In my eye, a question answered on the net is worth 10x as much as one answered in a letter, because there are a lot of lurkers who don't post much, but read for their education. If, however, the posted question is of a simple nature; I usually just mail a reply saying that, yes, PBGetCatInfo CAN be your friend, too :-) and then point towards the FAQ. Cheers, / h+ -- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe -- "From now on I will re-label the EQ on the deck as Fizz and Wobble instead of HF and LF." +++++++++++++++++++++++++++ >From peter@ncrpda.curtin.edu.au (Peter N Lewis) Date: 21 Feb 1994 11:45:58 +0800 Organization: NCRPDA, Curtin University feats@vtvm1.cc.vt.edu writes: >newsgroup! What exactly are the rules for posting questions on this >Newsgroup? Is there a limit to the quantity of questions one person may >ask or do your questions have to be of a certain complexity? There are no rules, which just makes it worse really. Most people wont single you out because you've posted too many messages, but they may well not answer because of what's in your message. Things to try to remember: First, try to answer the question yourself, if you don't spend at least a few hours trying to figure it out first, then you probably wont even know the right question to ask. Next, make the subject appropriate. Subjects like "HELP!!!" are useless, subjects need to define the problem so that people interested in that area, or experts in that area will read your post. Then be consise but complete. Make it clear what you are trying to do and why you are failing. If you have bugs in your code, make sure you have found exactly which bit is failing, make sure you are checking all the error return values, and produce a simple, short piece of code that demonstrates the error. No one here can (or will) debug your application for you - a code snippet sure, but not your application. Offer to take email responses and to summarize them, but also follow the thread in news. Don't say "Email responses, I don't read this group". If you don't read the group, then you aren't contributing, so why should anyone help you. If you can't even take the time to read the group for a few weeks, forget about posting. And if you don't normally read the group, then check vbery carefully all the articles already there and see if your question comes up. Also, check if it is in the FAQ (usually available from rtfm.mit.edu:/pub/usenet). And do summarize the responses if there are more than a few (or if there are any in Email that aren't already posted). Others have the same questions as you do. And then put what you learnt back - if someone else posts a question that you've had answered, answer it! There are only a few reasons that your post wont get any responses: 1) No one knows. 2) Some people know. 2.1) but they didn't see your post (bad subject) 2.2) couldn't figure out what your problem was (bad article) 2.3) you pissed them off with some comment (insulted someone/something, perhaps had some random religous comment in your sig, whatever). 2.4) you sounded like you had no idea what you were talking about (this makes it difficult to answer, since the answer must start from basic principles and go from there which is too tedious). Enjoy, Peter. -- _______________________________________________________________________ Peter N Lewis <peter.lewis@info.curtin.edu.au> Ph: +61 9 368 2055 +++++++++++++++++++++++++++ >From ari@world.std.com (Ari I Halberstadt) Date: Tue, 22 Feb 1994 06:42:22 GMT Organization: The World Public Access UNIX, Brookline, MA In article <2k8h7n$hva@news.kth.se>, Jon Wdtte <d88-jwa@mumrik.nada.kth.se> wrote: >Once a week or so, I get a letter starting: > >"I see you answer a lot of questions on comp.sys.mac.programmer, so >I figured you could help me with..." Hi Jon, I see you answer a lot of questions on comp.sys.mac.programmer, so I figured you could help me with this simple question that's been bugging me for the last 5 minutes. I've been trying to figure out precisely how, using only BeginUpdate and EndUpdate and 3,500 other assorted Toolbox calls, to solve the mystery of Life the Universe and Everything. So far, no obvious solution has appeared, but perhaps you've already tackled and solved this problem. Forgive me if this is a really obvious thing which is right there in the docs, but I couldn't find it anywhere. :-) -- Ari Halberstadt ari@world.std.com #include <std/disclaimer.h> "These beetles were long considered to be very rare because very few entomologists look for beetles in the mountains, in winter, at night, during snow storms." -- Purves W. K., et al, "Life: The Science of --------------------------- >From thein@netcom.com (Hla Tun "Tim" Thein) Subject: Sending Apple Events from Excel Date: Tue, 22 Feb 1994 18:07:40 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) Does anyone know how to send Apple Events from MS Excel to an Apple Event Savvy application without writing any code resource? I've looked through the Excel manuals and even the Excel SDK book and it seems to suggest that some code resource needs to be written. If that's the case, would anyone have some code resource that they would like to share? Thanks, Tim +++++++++++++++++++++++++++ >From rmah@panix.com (Robert S. Mah) Date: Tue, 22 Feb 1994 16:22:57 -0500 Organization: One Step Beyond thein@netcom.com (Hla Tun "Tim" Thein) wrote: > Does anyone know how to send Apple Events from MS Excel to an Apple > Event Savvy application without writing any code resource? > > I've looked through the Excel manuals and even the Excel SDK book and > it seems to suggest that some code resource needs to be written. If Just write your code and make sure to name the resource correctly. It's all pretty straitforward -- the only complications come in "linking" the external to Excel. The one thing about using custom AE's from externals -- don't ask for a reply. The host application probably won't know what to do with it. An alternative is to simply use DDE. Excel supports this and DDE calls _can_ receive replies. The DDE calls are documented in the Macro reference (I think). And since DDE calls simply go out as high level events, your other application (if it's yours) can respond without any fuss. Another alternative is to use an external scripting system such as Frontier or AppleScript. This is probably the best way, as it will use the OSA standard and involve less mucking around inside Excel and speed development time. However, be careful about using Excel with DDE as the foundation of an application. You should be aware that while Excel is in "edit" mode, it cannot receive or send or receive any AppleEvents or DDE "events". I was once on a team that had to rewrite an Excel 4.0 based application because of this limitation. At the time, MS said they had no intention of changing this, and that to a customer that bought almost a million dollars of MS software every year. It may be fixed in 4.1 or maybe not -- I haven't checked. Cheers, Rob ________________________________________________________________________ Robert S. Mah One Step Beyond rmah@panix.com +++++++++++++++++++++++++++ >From Steven Ritter <sr0o+@andrew.cmu.edu> Date: Wed, 23 Feb 1994 10:40:37 -0500 Organization: Psychology, Carnegie Mellon, Pittsburgh, PA Excerpts from netnews.comp.sys.mac.programmer: 22-Feb-94 Re: Sending Apple Events fr.. by Robert S. Mah@panix.com > thein@netcom.com (Hla Tun "Tim" Thein) wrote: > > > Does anyone know how to send Apple Events from MS Excel to an Apple > > Event Savvy application without writing any code resource? > > > > I've looked through the Excel manuals and even the Excel SDK book and > > it seems to suggest that some code resource needs to be written. If > > Just write your code and make sure to name the resource correctly. It's > all pretty straitforward -- the only complications come in "linking" the > external to Excel. > This isn't much trouble either. If you're not up to writing this yourself, ISIS sells a product called S7PX that includes macros to send appleevents from Excel -- (818) 788-4747. I wrote a version for myself that is more limited than the ISIS one but allows other options that I need. If you tell me more specifically what you want to do, I might be able to help. > The one thing about using custom AE's from externals -- don't ask for a > reply. The host application probably won't know what to do with it. > I don't have any problem sending and receiving replies (you have to wait for a reply, not queue it). > However, be careful about using Excel with DDE as the foundation of an > application. You should be aware that while Excel is in "edit" mode, it > cannot receive or send or receive any AppleEvents or DDE "events". > I was once on a team that had to rewrite an Excel 4.0 based application > because of this limitation. At the time, MS said they had no intention > of changing this, and that to a customer that bought almost a million > dollars of MS software every year. It may be fixed in 4.1 or maybe not > -- I haven't checked. > Yes, this is really a big, big hassle. It's not so bad if you're waiting for a reply to your appleevent because SendAE will return "appleevent not handled". But if you're sending an appleevent that doesn't get a reply (like SetData), there is no way to tell whether Excel is listening or not. I now confirm SetData with subsequent GetData calls and retry the setdata if the result it different. On a related tack, there is a send mode parameter called "Want Receipt", which is supposed to give the client a "return receipt" if the appleevent was received. IM is very vague about what this means ("your application receives a return receipt as a high-level event") and I haven't been able to figure out how this works (if it does at all). Does anyone use this? Would this be a way of telling whether Excel accepted a SetData event? +++++++++++++++++++++++++++ >From isis@netcom.com (Mike Cohen) Date: Wed, 23 Feb 1994 19:04:36 GMT Organization: ISIS International rmah@panix.com (Robert S. Mah) writes: >thein@netcom.com (Hla Tun "Tim" Thein) wrote: >> Does anyone know how to send Apple Events from MS Excel to an Apple >> Event Savvy application without writing any code resource? >> >> I've looked through the Excel manuals and even the Excel SDK book and >> it seems to suggest that some code resource needs to be written. If My company (ISIS International) sells a product called System 7 Pack for Excel which lets you send AppleEvents, run AppleScript or Frontier scripts, and launch applications from within Excel macros. A demo is available via anonymous ftp on netcom.com in pub/isis/S7PX.demo.hqx. Sorry about the commercial post. -- Mike Cohen - isis@netcom.com NewtonMail: MikeC49506 / ALink: D6734 / AOL: MikeC20 --------------------------- >From Jon Little <little_j@kosmos.wcc.govt.nz> Subject: Strange launch erroor Date: 21 Feb 1994 22:18:21 GMT Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Hi netters/hackers While testing a Think Pascal routine which searches the memory for a reqhired application, iff the application isn't in memory then the routine tries to launch the application. This is when I get the strange error: "Chain and launch not allowed" in the following code - in the line marked {*****************} PROCEDURE LaunchApp (creator: OSType; tofront: boolean); VAR psn: ProcessSerialNumber; targetAddress: AEDesc; theEvent, theReply: AppleEvent; fileList: AEDescList; launchDesc: AEDesc; app_fs: FSSpec; launchThis: LaunchParamBlockRec; oe: OSErr; gv: longInt; sendmode: AESendMode; BEGIN IF (Gestalt(gestaltOSAttr, gv) = noErr) & (BTST(gv, gestaltLaunchControl)) THEN BEGIN IF GetPSN(creator, psn) THEN BEGIN IF tofront THEN BEGIN oe := SetFrontProcess(psn); END; END ELSE BEGIN IF MyGetAPPL(creator, app_fs) = noErr THEN BEGIN oe := AECreateDesc(typeApplSignature, @creator, sizeof(creator), targetAddress); oe := AECreateAppleEvent(kCoreEventClass, kAEOpenApplication, targetAddress, kAutoGenerateReturnID, kAnyTransactionID, theEvent); oe := AEDisposeDesc(targetAddress); launchThis.launchAppSpec := @app_fs; PrepareToLaunch(theEvent, tofront, launchDesc, launchThis); oe := LaunchApplication(@launchThis); {*****************} oe := AEDisposeDesc(theEvent); END; END; END; END; I am unable to find this error documernted anywhere so I would be grateful if anyone could tell me how to correct this error Thanks in advance Jon +++++++++++++++++++++++++++ >From siegel@netcom.com (Rich Siegel) Date: Tue, 22 Feb 1994 00:17:47 GMT Organization: Bare Bones Software In article <2kbbvd$f4l@st-james.comp.vuw.ac.nz> Jon Little <little_j@kosmos.wcc.govt.nz> writes: >Hi netters/hackers > >While testing a Think Pascal routine which searches the memory for a >reqhired application, iff the application isn't in memory then the >routine tries to launch the application. This is when I get the strange >error: "Chain and launch not allowed" in the following code - in the >line marked {*****************} THINK Pascal will not allow you to launch other applications from a program running within the THINK Pascal debugger. (If memory serves, either version 4.0.1 or 4.0.2 relaxes this restriction so that you can sub-launch applications under MultiFinder or System 7.) R. -- Rich Siegel % siegel@netcom.com % Principal, Bare Bones Software --> For information about BBEdit, finger bbedit@world.std.com <-- "He then proceeded to give a history of the universe, in real time." --------------------------- >From gneufeld@superior.carleton.ca (Grant Neufeld) Subject: TCL- CDLOGDialog [?] Date: Mon, 21 Feb 1994 09:08:31 GMT Organization: Carleton University I am trying to use a DLOG resource to display a dialog using Symantec's THINK Class Library (SC++ 6.0.1). My problem is that I can't get it to do the automatic recognition of the default "OK" button. The dialog comes up and can be dragged (I've selected a WDEF with a title bar), but the OK button isn't hilited and doesn't do anything when clicked. My class CAboutBox subclasses CDLOGDirector. /* My initialize procedure */ void CAboutBox::IAboutBox(CApplication *itsSupervisor) { TRY { inherited::IDLOGDirector(WIND_ABOUT, itsSupervisor); gDecorator->CenterWindow(itsWindow); TalkToUser(); /* display the dialog */ } CATCH { Dispose(); } ENDTRY; } /* my display procedure */ void CAboutBox::TalkToUser() { long dismissCommand; // The following line gets an "Error: access to 'SetDefaultButton' denied" // (CDialog)itsWindow->CDialog::SetDefaultButton(cmdOK); BeginModalDialog(); /* Only one button ("OK", DITL item 1) in my about dialog, */ /* so dismissCommand isn't used */ dismissCommand = DoModalDialog(cmdOK); } /* finally, I added the following to my application class's DoCommand */ case cmdAbout: theAboutBox = new(CAboutBox); theAboutBox->IAboutBox(this); theAboutBox->Dispose(); FlushEvents(mDownMask+mUpMask+keyDownMask+keyUpMask +autoKeyMask, 0); break; -- Grant Neufeld - gneufeld@ccs.carleton.ca - Ottawa, Ontario, Canada www http://arpp1.carleton.ca/arpp/Grant/Grant_Neufeld.html Apple Research Partnership Program, 1305 Dunton Tower, (613)788-2600ext3537 My views are too extreme to be anyone else's +++++++++++++++++++++++++++ >From eesau@uta.fi (Esa Ristil{) Date: 21 Feb 1994 13:20:59 +0200 Organization: University of Tampere, Finland Did you define command number to the OK button in DITL resource? You can do that by adding #1 after OK, so the text in the button should be 'OK#1' (without quotes). This works exactly the way menu commands are initialized in the menu resource. In DITL though, you can't put command numbers anywhere else than plain buttons, no radiobuttons checkboxes or other things. -- Esa Ristil{ * eesau@uta.fi Homo homini lupus +++++++++++++++++++++++++++ >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte) Date: 21 Feb 1994 13:45:38 GMT Organization: Royal Institute of Technology, Stockholm, Sweden In <gneufeld.761821711@superior> gneufeld@superior.carleton.ca (Grant Neufeld) writes: > /* Only one button ("OK", DITL item 1) in my about dialog, */ You probably forgot to give the button a command number by naming it OK#100 Cheers, / h+ -- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe -- _/~| Yellow / * \_ Shark (This signature has won the "Worst ASCII ~~~~\/ Software Logo of the Year" award) +++++++++++++++++++++++++++ >From Steve Bryan <sbryan@maroon.tc.umn.edu> Date: Mon, 21 Feb 1994 20:54:58 GMT Organization: Sexton Software In article <gneufeld.761821711@superior> Grant Neufeld, gneufeld@superior.carleton.ca writes: >My problem is that I can't get it to do the automatic recognition of >the default "OK" button. The dialog comes up and can be dragged (I've >selected a WDEF with a title bar), but the OK button isn't hilited and >doesn't do anything when clicked. There are at least two things you need to do. First use ResEdit to change the text of your default button in the dialog to add a command number, just like you do for menu items (they share the same parser). I believe there is a defined constant that should be used by convention for dialogs (found it in Commands.h: #define cmdOK 100L). So if the text of your default button was "OK" change it to "OK#100". The other thing you need to do is send the message SetDefaultCmd to your dialog director informing it that cmdOK is to be your default command. I don't have my projects online but that's the idea and it has worked for me. -Steve Bryan +++++++++++++++++++++++++++ >From Steve Bryan <sbryan@maroon.tc.umn.edu> Date: Mon, 21 Feb 1994 21:55:05 GMT Organization: Sexton Software In article <2ka5erINNd81@kielo.uta.fi> Esa Ristil{, eesau@uta.fi writes: >should be 'OK#1' (without quotes). This works exactly the way That may work but I would use "OK#100" which would associate the button with cmdOK. I believe that cmdQuit is asigned to command number 1. The other step that might need to be taken is sending the SetDefaultCmd message to the dialog director so it knows what command to be the default. It draws the outline and handles the default behavior after that. -Steve Bryan --------------------------- >From ctaylor@fox.nstn.ns.ca (Chris Taylor) Subject: Time Manager Date: 21 Feb 1994 18:07:23 -0400 Organization: The Party Palace I've benn doing some stuff with the extended Time Manager. I'm using some of the sample code from Inside Macintosh VI (chapter 23). I'm setting it up to use the InsXTime proc, and my actual procedure uses the A5 world of my app, as well as reactivating itself with a delay of 1000 miliseconds (1 second). This seems to conflict with the WaitNextEvent function because when I install the task, THINK Pascal stops the program, and tell me that there's a bus error in the WaitNextEvent line, then it locks up. It works fine without installing the Time Manager task, and I have no extension conflicts. Also, it's not in my task installation procedure or in the task itself (I've checked them all). Can someone please help me here?!?! I need to use the extended time manager! Please e-mail me if you can help. Christian +---------------------+----------------------------------+ | Christian Taylor | Internet: ctaylor@fox.nstn.ns.ca | |The Party Palace BBS | CIS : 71442,1161 | | (902) 679-1218 | AOL : Chris1020 | +---------------------+----------------------------------+ +++++++++++++++++++++++++++ >From minow@apple.com (Martin Minow) Date: Tue, 22 Feb 1994 19:57:32 GMT Organization: Macintosh Developer Services In article <ctaylor-210294180428@wolfville-ts-14.nstn.ns.ca>, ctaylor@fox.nstn.ns.ca (Chris Taylor) wrote: > > I've benn doing some stuff with the extended Time Manager. I'm using some > of the sample code from Inside Macintosh VI (chapter 23). I'm setting it > up to use the InsXTime proc, and my actual procedure uses the A5 world of > my app, as well as reactivating itself with a delay of 1000 miliseconds (1 > second). Your Time Manager completion routine is called when the time interval finishes, and some other process or application may be running.. Consequently, before installing the task, you must save a copy of your application's A5 "somewhere" where the completion routine can access it (generally, at a fixed offset from the TMTask. The easist way to do this is to create an extended task structure, such as the following: typedef struct { TMTask tmTask; long tmApplicationA5; } TMInfoRecord; TMInfoRecord gTMInfoRecord; gTMInfoRecord.tmTask.FOO = BAR; /* Setup TMTaskRecord */ gTMInfoRecord.tmApplicationA5 = SetCurrentA5(); InsTime((QElemPtr) &gTMInfoRecord.tmTask); ... Your time manager task callback function would look like this: pascal void MyTimeManagerTask(void) { register TMInfoRecord *tmInfoPtr; long oldA5; asm { move.l a1,tmInfoPtr; } oldA5 = SetA5(tmInfoPtr->tmApplicationA5; ... other stuff ... (void) SetA5(oldA5); } Note that you cannot call QuickDraw or any function that may move memory from your time manager task. Hope this helps. Martin Minow minow@apple.com The above does not represent the position of Apple Computer Inc. --------------------------- >From Dan Crevier <dan@rhino.harvard.edu> Subject: Tip for Think C and Radius monitor users Date: 21 Feb 1994 01:44:40 -0500 Organization: Harvard University I've got a radius monitor, and have always been frustrated that when using Think C, I can't use the option-click in a window's title feature to get a list of the header files because RadiusWare makes it so that an option-click in the title zooms the window, and there seemed to be no way to turn this "feature" off. Well, playing around with Resorcerer, I found that there is a resource type 'RPRM' (with a TMPL resource to match) that has a field called "no Option Title zoom", and if you change this to on, then you an use the option-click feature in Think C. Just thought I'd mention it in case someone else finds it useful... Dan --------------------------- >From stevej@umcc.umcc.umich.edu (Steve Jovanovic) Subject: Universal Headers (A) Date: 22 Feb 1994 03:35:54 -0500 Organization: TopSoft, Inc. Hi Netters, Recently, someone asked where to find the Universal Headers, and the universal QuickTime headers. The generic MPW Universal headers (CIncludes) are available on the _develop_ #16 CD. However, they only include the generic headers-- the System 7.1-specific headers are missing (some of the OSL headers, QT, etc.) The good news, though, is that you can find the missing ones on the CodeWarrior DR1 CD! I was looking everywhere for the QuickTime uni's too and finally found them on the DR1 CD! Oddly, they're not in the 68K folder/s, but in the PowerPC folder/s. I can't recall exactly in which directory you'll find them, but if you use the Finder's Find... and do a search for "ImageCompression.h" (it'll take a while :P ) you'll find them in *that* folder :) as well as the Speech Manager uni header, OSA uni's, etc. Also, someone else asked about experiences using universal headers under TC or SymC++. That's what we did with FilterTop. I just took CIncludes from _develop_ 16 and trashed Symantec's headers. For some reason, the Symantec compilers have a problem with FixMath.h (specifically, 4 lines). If you comment them out you'll be fine. (The problem is caused by a conditional compilation directive--e-mail me if you need the details). It took a couple of days of full-time work to convert several dozen K lines of source to compile and work properly under the uni headers--there are a bunch of gotchas...but it's not hard. The only real guide that I've come across is the "Making the Leap to PowerPC" article in _develop_ #16. (It's also available in DocViewer format on the CodeWarrior CD). This is a bit of an aside, but if you're starting on a new project with the uni headers (this is a good rule to follow in general regardless of which headers you're using)...when you declare struct's, etc. name your data members starting with an "f" or something like that...like this: typedef struct TopSoft { short fMembers; short fProducts; char *fCharacters; } *TopSoftPtr, **TopSoftHdl; The reason that might be a good idea is becuase I've come across a bunch of non-obvious name conflicts that cause MPW C++ to choke (but only w/ uni headers); it's important to ensure that you use unique names! If you get obscure "illegal combination of type specifiers" errors from MPW C++ (and in those, MPW doesn't give line #s!) that might be the cause. Anyway, good luck--I hope this helps. steve +----------------------+---------------------------+----------------------+ | Steve Jovanovic | President, TopSoft, Inc. | 2918 Goold St. | | Marquette University +---------------------------+ Racine, WI 53404 | | Computer Engineering | Internet: stevej@ais.org | (414) 632-0336 | +----------------------+---------------------------+----------------------+ | "Blue skies above, sun on your arms, strength in your stride, and hope | | in those squeaky clean eyes..." -- "Teenage Wildlife," David Bowie | +-------------------------------------------------------------------------+ --------------------------- >From adelucia@eden.rutgers.edu (Apple-O) Subject: c source code for simple-classic-old mac arcade type games wanted Date: 21 Feb 94 08:16:52 GMT Organization: Rutgers Univ., New Brunswick, N.J. I'm interested in learning how to program games on my mac, using C. Being new to C (and mac) I'm unsure of graphics techniques, functions, etc. as well as sound. If anyone has any simple games source code (a plus if well documented), I'd probably be able to learn something from looking at it, & playing around & modifying things. Does anyone know any C libraries which include graphics or sound functions? -- Apollo +++++++++++++++++++++++++++ >From kenlong@netcom.com (Ken Long) Date: Mon, 21 Feb 1994 16:33:04 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) There are a few C game sorces available - from simple to complex. The Sprite Animation Toolkit has "Space Invaders" type source, as well as other forms of animation demos. There's a Pascal source set for "HeartQuest" in the package, too. "NewMaxell" has some buggy B/W "game" source, in C. On ftp oak.oakland.edu, there's some old C source for a "Go" game. I'm working on updating this source and will post upon completion. The "SpriteWorld" source package has some "game" demo source. The Arashi 1.0 and 1.1 source is on Stanford and Univ. Michigan ftps. Full color, direct to screen, graphics, animation, sound, sound compression, etc. "Cheese Toast" is a Malestrom-type game source package. FPU required for the built application. I ordered and received the source for "MacMan" (the B/W version) and the source may still be available. ($15) There's some Tetris-type sources available. There is a source project called "Hearts" - a card game - available from the authors. Here, on Netcom, there are some ANSI game sources. Poker, tetris, Monopoly, Snake and others. Not much help for a beginner, since they are not "Mac-like" or even for Think C, but game source, none the less. Then, you can write to authors and ask for source. I've gotten several sources - some of which I'm not allowed (nor would I) to distribute - from authors upon request. They rule of thumb is: When you see a program you want the source for, ASK immediately. I've gotten some publically available source, even at a price, only to find other's later attemps to get the same source failed due to authors changing their mind about releasing it. One of the best game source projects I got was from an author who had not released anything since 1985. No addresses in his program were current. So, with a little detective work, and some 555-1212 calls, I was able to contact him. A Mac to Mac telecom connection transmitted the source. Also, you may be able to get source for games authors have given up on. They may no longer have the time or willingness to complete the development of some project. You can work deals to complete the development of such projects. I was given source on that basis. But, upon reviewing the source, I could see that a complete rewrite, using modern methods, would have been the best course of action. As such, the old code only had historical value, or training value. And, since the original game was started, several competitive games have already been released by others, making it an unfeasable shareware proposition. This may not always be the case, though. Ken kenlong@netcom.com "It's better to have a Mac and not need it, than to need a Mac and not have it." --------------------------- >From todd_J._Lipcon@fourd.com (todd J. Lipcon) Subject: showtext-pascal Date: 20 Feb 1994 11:29:14 -0600 Organization: 4th Dimension BBS Is there a very easy way to save the contents of THINK Pascal's built-in Text window to a teachtext file? I really don't want to have to figure out the entire TE manager! The program generates a series of prime numbers and right now it puts them into the text window using writeln(). If I cant do what I want, does anyone have any simlpe TE routines? Thanks for the help! Scott Lipcon reply to: Scott.Lipcon@zorro9.fidonet.org, or Scott@fourd.com ******************************************************************** System: fourd.com Phone: 617-494-0565 Cute quote: Being a computer means never having to say you're sorry ******************************************************************** +++++++++++++++++++++++++++ >From robertl@netcom.com (Robert L Mathews) Date: Mon, 21 Feb 1994 11:32:46 GMT Organization: Tiger Technologies todd J. Lipcon (todd_J._Lipcon@fourd.com) wrote: : Is there a very easy way to save the contents of THINK Pascal's built-in Text : window to a teachtext file? I really don't want to have to figure out the : entire TE manager! The program generates a series of prime numbers and right : now it puts them into the text window using writeln(). If I cant do what I : want, does anyone have any simlpe TE routines? You're under a misapprehension here: TextEdit has nothing to do whatsoever with TeachText files (not from the point of view of a program that wants to create them, anyway). TextEdit is what TeachText uses internally to display your file, but all your file needs to contain is a series of characters. This being the case, simply do the following: o Create a new file (data fork) on the disk of type 'TEXT', creator 'ttxt'. Use a toolbox call such as FSpCreate or HCreate, depending on whether the System 7-only FSSpec calls are available. o Open the file using FSpOpenDF or HOpen. o Use FSWrite to write the text to the file. Do this for each line you want in the file, writing a carriage return (or two) wherever you want to have carriage returns. o Use FSClose when you're finished. This should get you going - if this is going into a real program, you'll want to be sure to check for errors and allow the user to name and choose the location of the file, using StandardPutFile or one of its more complicated ancestors or cousins. -- Robert L Mathews, Tiger Technologies +++++++++++++++++++++++++++ >From reinkeha@dunx1.ocs.drexel.edu (Harry A. Reinke) Date: Mon, 21 Feb 1994 14:50:18 GMT Organization: Drexel University, Phila. Pa. My only suggestion is that you use two procedures, one for text output, and another to a file. If you need code for how to output to a file I can help you there as well. If you want to look into it on your own ... look at FSWRITE,FSREAD,STANDARDPUTFILE. Bye. +++++++++++++++++++++++++++ >From bn9606@beorn (Brian Novack) Date: 21 Feb 94 17:09:24 GMT Organization: WU-Wien In article <131305467.29614446@fourd.fourd.com> from [20 Feb 94 17:29:14 GMT] you wrote: |> Is there a very easy way to save the contents of THINK Pascal's built-in Text |> window to a teachtext file? I really don't want to have to figure out the |> entire TE manager! The program generates a series of prime numbers and right |> now it puts them into the text window using writeln(). If I cant do what I |> want, does anyone have any simlpe TE routines? |> Thanks for the help! |> Scott Lipcon |> reply to: Scott.Lipcon@zorro9.fidonet.org, or Scott@fourd.com |> |> ******************************************************************** |> System: fourd.com Phone: 617-494-0565 |> Cute quote: Being a computer means never having to say you're sorry |> ******************************************************************** Under the Run Options, you can tell it to save the text window to a file, and adjust the buffer size of the window as well (how many characters it will hold). ---Brian Novack +++++++++++++++++++++++++++ >From peter@ncrpda.curtin.edu.au (Peter N Lewis) Date: 22 Feb 1994 12:37:59 +0800 Organization: NCRPDA, Curtin University todd_J._Lipcon@fourd.com (todd J. Lipcon) writes: >Is there a very easy way to save the contents of THINK Pascal's built-in Text >window to a teachtext file? I really don't want to have to figure out the Well, choose Save as... works for me. I think it requires at least TP 4, maybe even 4.0.2. But it works fine, saves the text window to a TeachText document. Peter. -- _______________________________________________________________________ Peter N Lewis <peter.lewis@info.curtin.edu.au> Ph: +61 9 368 2055 --------------------------- End of C.S.M.P. Digest **********************